﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NineMine.DataModel
{
    public class AuthSource
    {
        [Key]
        public long Id { get; set; }

        [MaxLength(30), Required]
        public string AuthType { get; set; }

        [MaxLength(30), Required]
        public string AuthName{ get; set; }
    
        [MaxLength(60)]
        public string Host { get; set; }

        public long Port { get; set; }

        [MaxLength(255)]
        public string Account { get; set; }

        [MaxLength(255)]
        public string AccountPassword { get; set; }

        [MaxLength(255)]
        public string BaseDN { get; set; }

        [MaxLength(30)]
        public string AttributeLogin { get; set; }

        [MaxLength(30)]
        public string AttributeFirstName { get; set; }

        [MaxLength(30)]
        public string AttributeLastName { get; set; }

        [MaxLength(30)]
        public string AttributeMail { get; set; }

        public bool OnTheFlyRegister { get; set; }

        public bool Tls { get; set; }

        [MaxLength(255)]
        public string Filter { get; set; }

        public long Timeout { get; set; }
        
        public virtual bool AllowPasswordChanges
        {
            get { return false; }
        }

        public virtual bool Searchable
        {
            get { return false; }
        }
    }
}
